﻿@inject CategoryService _categoryService
@{ 
    var categories = await _categoryService.GetCategoriesAsync();
}

<h4>分类</h4>
<hr />
<ul class="list-unstyled">
    @foreach (var item in categories)
    {
        <li class="mt-3">
            <a asp-page="./List" asp-route-categoryId="@item.Id">@(item.Name)(@item.Articles.Count)</a>
        </li>
    }
</ul>